<!--  -->
<template>
  <div class="version-update" v-if="!isAgent">
    <div class="header">{{versionInfo.name}}<span class="createAt">发布于：{{versionInfo.createAt | dateformat('YYYY-MM-DD')}}</span><a :href="versionInfo.more" class="more" target="_blank">查看更多></a></div>
    <!-- <div class="con" v-loading="loadingv">
      <el-scrollbar style="height:100%;">
        <div v-html='versionInfo.content'></div>
      </el-scrollbar>
      <div v-html='versionInfo.content'></div>
    </div> -->
  </div>
</template>

<script>
import * as functions from '@/core/functions.js'
export default {
  data () {
    return {
      versionInfo: {
        name: '',
        content: '',
        createAt: null,
        more: ''
      },
      loadingv: true,
      isAgent: true
    }
  },
  created () {
    // 请求获取版本更新信息
    this.$post('/center/renew').then(
      response => {
        this.versionInfo.name = response.name
        this.versionInfo.content = response.content
        this.versionInfo.createAt = response.createAt
        this.versionInfo.more = response.more
        this.loadingv = false
      },
      error => {
        console.error(error)
      }
    )
    // 是否代理商
    functions.agentInfo().then(agent => {
      if (parseInt(agent.loginAgentDomain) === 1) {
        this.isAgent = true
      } else {
        this.isAgent = false
      }
    })
  },
  methods: {
  },
  computed: {

  }
}

</script>
<style scoped lang="scss">
.version-update {
  border: 1px solid #e5e5e5;
  .header {
    padding: 10px 85px 10px 15px;
    background-color: #eeeeee;
    min-height: 35px;
    position: relative;
    .createAt{
      font-size: 12px;
      color:#999;
      padding-left: 15px;
    }
    .more {
      position: absolute;
      right: 10px;
      top: 50%;
      line-height: 1.5;
      margin-top: -0.75em;
    }
  }
  .con {
    padding: 15px;
    font-size: 13px;
    min-height: 100px;
    /deep/ img{
      max-width: 100%;
    }
  }
}
.version-update /deep/ {
  .el-scrollbar__wrap {
    overflow-x: hidden;
  }
  .is-horizontal{
    display: none;
  }
}
</style>
